package com.cloudkinto.service.order.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class OrderFulfillmentOrderEntity {

    @JsonProperty("id")
    private Long id;
    @JsonProperty("shop_id")
    private Long shopId;
    @JsonProperty("order_id")
    private Long orderId;
    @JsonProperty("assigned_location_id")
    private Long assignedLocationId;
    @JsonProperty("request_status")
    private String requestStatus;
    @JsonProperty("status")
    private String status;
    @JsonProperty("supported_actions")
    private List<?> supportedActions;
    @JsonProperty("destination")
    private DestinationDTO destination;
    @JsonProperty("line_items")
    private List<LineItemsDTO> lineItems;
    @JsonProperty("fulfill_at")
    private String fulfillAt;
    @JsonProperty("fulfill_by")
    private Object fulfillBy;
    @JsonProperty("international_duties")
    private Object internationalDuties;
    @JsonProperty("fulfillment_holds")
    private List<?> fulfillmentHolds;
    @JsonProperty("delivery_method")
    private DeliveryMethodDTO deliveryMethod;
    @JsonProperty("assigned_location")
    private AssignedLocationDTO assignedLocation;
    @JsonProperty("merchant_requests")
    private List<?> merchantRequests;

    @NoArgsConstructor
    @Data
    public static class DestinationDTO {
        @JsonProperty("id")
        private Long id;
        @JsonProperty("address1")
        private String address1;
        @JsonProperty("address2")
        private String address2;
        @JsonProperty("city")
        private String city;
        @JsonProperty("company")
        private Object company;
        @JsonProperty("country")
        private String country;
        @JsonProperty("email")
        private String email;
        @JsonProperty("first_name")
        private String firstName;
        @JsonProperty("last_name")
        private String lastName;
        @JsonProperty("phone")
        private String phone;
        @JsonProperty("province")
        private String province;
        @JsonProperty("zip")
        private String zip;
    }

    @NoArgsConstructor
    @Data
    public static class DeliveryMethodDTO {
        @JsonProperty("id")
        private Long id;
        @JsonProperty("method_type")
        private String methodType;
        @JsonProperty("min_delivery_date_time")
        private Object minDeliveryDateTime;
        @JsonProperty("max_delivery_date_time")
        private Object maxDeliveryDateTime;
    }

    @NoArgsConstructor
    @Data
    public static class AssignedLocationDTO {
        @JsonProperty("address1")
        private String address1;
        @JsonProperty("address2")
        private String address2;
        @JsonProperty("city")
        private String city;
        @JsonProperty("country_code")
        private String countryCode;
        @JsonProperty("location_id")
        private Long locationId;
        @JsonProperty("name")
        private String name;
        @JsonProperty("phone")
        private String phone;
        @JsonProperty("province")
        private String province;
        @JsonProperty("zip")
        private String zip;
    }

    @NoArgsConstructor
    @Data
    public static class LineItemsDTO {
        @JsonProperty("id")
        private Long id;
        @JsonProperty("shop_id")
        private Long shopId;
        @JsonProperty("fulfillment_order_id")
        private Long fulfillmentOrderId;
        @JsonProperty("quantity")
        private Integer quantity;
        @JsonProperty("line_item_id")
        private Long lineItemId;
        @JsonProperty("inventory_item_id")
        private Long inventoryItemId;
        @JsonProperty("fulfillable_quantity")
        private Integer fulfillableQuantity;
        @JsonProperty("variant_id")
        private Long variantId;
    }
}
